<?php
$app_config = require(dirname(__FILE__) . '/../config/boot.php');
require $app_config['QEEPHP_DIR'] . '/library/q.php';
require $app_config['APP_DIR'] . '/myapp.php';
$ret = MyApp::instance($app_config);
header("content-type:image/jpeg");
$number = (isset($_GET['number']) && $_GET['number']) ? $_GET['number'] : '';
if ($number)
{
	$product = Product_Basic::find('number=?', $number)->asArray()->getOne();
	if ($product)
	{
		$imgs = $product['img'];
		if ($imgs)
		{
			$context = stream_context_create(array('http' => array('header' => 'Referer:http://kealvin.erp.zcool.com:8280/zc/index.php')));
			$img = file_get_contents($imgs, 0, $context);
			echo $img;
		}
	}
}
